home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amiga / visualarts / source / graphicpattern / graphicpattern_func.c next >
Encoding:
C/C++ Source or Header  |  1995-04-02  |  2.1 KB  |  73 lines

  1. /* C code generated by:                            */
  2. /* Visual Arts Version 2.1                        */
  3. /* Copyright (c)1994-95 Danny Y. Wong  All rights reserved        */
  4. /* Calgary, Alberta (CANADA)                                    */
  5.  
  6. int  InitTempArea(void);
  7. extern void GraPatDrawCircles(struct Window *Wind);
  8. extern void GraPatDrawRects(struct Window *Wind);
  9. extern struct Window  *GraPatWnd;
  10.  
  11. void GraPatDrawRects(struct Window *Wind)
  12. {
  13.   UWORD offsetx = Scr->WBorLeft;
  14.   UWORD offsety = Scr->WBorTop + Scr->RastPort.TxHeight + 1;
  15.  
  16.   DrawBox(Wind, 5, 2, 200, 75, 1, 0 );
  17.   DrawBevelBox(Wind->RPort, 17+offsetx, 8+offsety, 171, 62, 
  18.     (GT_VisualInfo), VisualInfo, TAG_DONE);
  19.   DrawFBox(Wind, 30, 14, 145, 49, 3, 0, 0, 25 );
  20.   DrawFBox(Wind, 59, 25, 86, 28, 1, 0, 1, 34 );
  21.   DrawBevelBox(Wind->RPort, 29+offsetx, 13+offsety, 147, 51, 
  22.     (GT_VisualInfo), VisualInfo, TAG_DONE);
  23.   DrawBevelBox(Wind->RPort, 58+offsetx, 24+offsety, 88, 30, 
  24.     (GT_VisualInfo), VisualInfo, (GTBB_Recessed), TRUE, TAG_DONE);
  25.   DrawFBox(Wind, 218, 68, 129, 9, 2, 0, 1, 20 );
  26.   DrawBox(Wind, 210, 2, 153, 62, 2, 2 );
  27.   SetDrPt(Wind->RPort, 0xFFFF);
  28.   SetOPen(Wind->RPort, 0);
  29.   SetAfPt(Wind->RPort, NULL, 0);
  30. }
  31.  
  32. void GraPatDrawCircles(struct Window *Wind)
  33. {
  34.   DrawFCircle(Wind, 256, 14, 25, 9, 1, 0, 1, 47 );
  35.   DrawFCircle(Wind, 326, 14, 25, 9, 1, 0, 1, 47 );
  36.   DrawFCircle(Wind, 311, 14, 7, 3, 2, 0, 1, 47 );
  37.   DrawFCircle(Wind, 271, 14, 7, 3, 2, 0, 1, 47 );
  38.   DrawFCircle(Wind, 391, 34, 17, 28, 2, 0, 1, 18 );
  39.   DrawFCircle(Wind, 390, 71, 34, 7, 3, 0, 1, 15 );
  40. }
  41.  
  42. void GraPatDrawLine(struct Window *Wind)
  43. {
  44.   DrawLine(Wind, 283, 23, 268, 40, 1, 0 );
  45.   DrawLine(Wind, 269, 40, 308, 34, 1, 0 );
  46.   DrawLine(Wind, 241, 51, 337, 45, 1, 0 );
  47.   DrawLine(Wind, 274, 60, 299, 59, 1, 0 );
  48. }
  49.  
  50. struct AreaInfo areaInfo={0};
  51. struct TmpRas Temprast;
  52. PLANEPTR AreaPlane=NULL;
  53. WORD areaBuffer[4000];
  54.  
  55.  
  56. int InitTempArea(void)
  57. {
  58.   register UWORD i;
  59.  
  60.   for (i=0; i<4000; i++)
  61.     areaBuffer[i]=0;
  62.   InitArea(&areaInfo, areaBuffer, 800L);
  63.   AreaPlane = AllocRaster(640, 200);
  64.   if (AreaPlane == NULL)
  65.       return(1L);
  66.   InitTmpRas(&Temprast, AreaPlane, (long)RASSIZE(640, 200));
  67.       return(0L);
  68. }
  69.  
  70.  
  71.              /* gadget functions */
  72.  
  73.